<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" session="true" %>
<%
	HttpSession actualSession = request.getSession(true);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />




<!-- TemplateBeginEditable name="doctitle" -->
<title>Where I Was</title>
<!-- TemplateEndEditable -->
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css"/>
<!-- TemplateBeginEditable name="head" -->
<div id="opciones"><table>
<%
	if(session.getAttribute("LoggedIn") != null){
%>
   <tr> <td></td><td><a href="/view_log.jsp">View Log</a></td> <td></td><td></td><td></td><td></td>
<%
	}
%>
        <td></td><td><a href="/help.jsp">View Where I Was Info</a><td><td></td><td></td><td></td>
		<td></td><td colspan="3"><%= (String)session.getAttribute("UserName") %></td><td></td><td></td><td></td>
		<td></td><td><a href="/register_location.jsp">Register Location</a><td></td><td></td><td></td><td></td><td></td><td></td>
		<td></td></td><td><a href="/register_device.jsp">Register a Device</a></td><td></td><td></td><td></td><td></td>
		<td></td><td></td><td colspan="3"><a href="/log_out">Log Out</a></td><td></td></tr>	
    </table>
	</div>
</div>
<!-- TemplateEndEditable -->
</head>
<!-- TemplateBeginEditable name="bodytag" -->
<body>
<!--TemplateEndEditable -->
<h1> Where I Was </h1>
q
<div id="LoginDiv">
<%
	if(session.getAttribute("LoggedIn") != null){
	boolean isLoggedIn = (Boolean)session.getAttribute("LoggedIn");
		if(isLoggedIn){
%>
	<table>
		<tr><td colspan="3"><%= (String)session.getAttribute("UserName") %></td></tr>
		<tr><td><a href="/register_location.jsp">Register Location</a></td><td><a href="/register_device.jsp">Register a Device</a></td></tr>
		<tr><td colspan="3"><a href="/log_out">Log Out</a></td></tr>
	</table>
<%
		}
	}else{
%>
	<form action="/login" method="post">
    	<table>
        	<tr>
            	<td>Username</td>
                <td><input type="text" name="username" /></td>
                <td>Password</td>
                <td><input type="password" name="password" /></td>
            </tr>
            <tr>
				<td><input type="submit" value="LogIn" /></td>
                <td><input type="reset" value="Restore Fields" /></td>
                <td colspan="2"><a href="/registration.jsp">Register a User</a></td>
            </tr>
        </table>
    </form>
<%
	}
%>
</div>
<div id="Menu">
	<ul>
<%
	if(session.getAttribute("LoggedIn") != null){
%>
    	<li><a href="/view_log.jsp">View Log</a></li>
<%
	}
%>
        <li><a href="/help.jsp">View Where I Was Info</a></li>
    </ul>
</div>
<div id="centro">
<!-- TemplateBeginEditable name="Body" -->
<!-- TemplateEndEditable -->
</div>
<div id="PoweredByGoogle">
<img src="https://developers.google.com/appengine/images/appengine-silver-120x30.gif" 
alt="Powered by Google App Engine" />
<div id="PoweredByAndroid">
<img src="http://1.bp.blogspot.com/_1i7EX7a2ELY/THKCOo4GjQI/AAAAAAAAATg/N-j9SfzyGjk/s200/500px-android-logosvg.png" alt="Powered by Android" height="50" width="50"/>
</div>
</div>
</body>
</html>